#define _CRT_SECURE_NO_WARNINGS 1

#include <iostream>
const long long MAX = 1e7;

using namespace std;

int main()
{
    long long n = 0;
    cin >> n;
    long arr[MAX] = { 0 };
    int count = 0;
    for (int i = 0; i < n; i++)
    {
        scanf("%d",&arr[i]);
    }

    for (int j = 0; j < n; j++)
    {
        if ((j <= 2) && (arr[j] != 1))
        {
            count++;
            arr[j] = 1;
        }
        else if (arr[j - 1] + arr[j - 2] != arr[j])
        {
            count++;
            arr[j] = arr[j - 2] + arr[j - 1];
        }
    }
    cout << count;

    return 0;
}